package com.shd.day05;

import java.util.stream.Stream;

/**
 * Created by shanhaodong on 2018/7/28
 */
public class CreateStrem {
    public static void main(String[] args) {
        Stream.iterate(new int[]{0, 1}, t -> new int[]{t[1], t[0] + t[1]})
                .limit(20).forEach(t -> System.out.println(t[0]));

        // Generate Stream
        Stream.generate(Math::random).limit(10).forEach(System.out::println);

    }


}
